Dynomotion

Group: DynoMotion Message: 2046 From: Weerasak Date: 10/28/2011
Subject: Click Reset button cause x dro increase value
Hello Tom,

I have problem with EnableAxisDest (0,ch0->Position); command, each time I click the Reset button in Mach3, it increase the x value. Please see the video.

http://www.youtube.com/watch?v=9rA8JLOvDeg

pardon me, if you have already answered this problem,But I couldn't find it.

Thanks
Weerasak
Group: DynoMotion Message: 2047 From: Weerasak Date: 10/28/2011
Subject: Re: Click Reset button cause x dro increase value
Hello,

Youtube takes hours to process my uploaded video, I upload another one, here new link

http://s389.photobucket.com/albums/oo335/vrasak/?action=view¤t=KflopKanalog1.mp4

Thanks
Weerasak

This video is currently being processed.

--- In DynoMotion@yahoogroups.com, "Weerasak" <vrasak@...> wrote:
>
> Hello Tom,
>
> I have problem with EnableAxisDest (0,ch0->Position); command, each time I click the Reset button in Mach3, it increase the x value. Please see the video.
>
> http://www.youtube.com/watch?v=9rA8JLOvDeg
>
> pardon me, if you have already answered this problem,But I couldn't find it.
>
> Thanks
> Weerasak
>
Group: DynoMotion Message: 2049 From: Tom Kerekes Date: 10/28/2011
Subject: Re: Click Reset button cause x dro increase value
Hi Weerasak,
 
I don't think that is really a problem.  This just means that the commanded destination is slightly different after each reset.  Not that there is a loss or shift in position.  Each RESET the Init.c program reads the current measured encoder position and sets the commanded destination to match.  The encoder position is not reset or adjusted.  So if the servo has a small error (which it usually have at least a fraction of one encoder count) the commanded position is adjusted to match.  If the system is then moved somewhere (ie zero) it will always be to the same place.  You can verify this behavior by forcing a large error.  Command the axis to zero and mark the position.  Then force a big error of ~100mm (you might disable the amp).  Then RESET the system.  Mach3 will the report the position as ~100mm.  Command the axis back to zero and the position should repeat within the mechanical accuracy of your axis.
 
If you still feel this is a problem you could add a move in your Init program to a fixed machine coordinate.  But this could be dangerous for example if for some reason you need to RESET after some fault in the middle of cutting a part.
 
Does this make sense?
 
Regards
TK

Group: DynoMotion Message: 2052 From: Weerasak Date: 10/28/2011
Subject: Re: Click Reset button cause x dro increase value
Hello Tom,

Yes, it makes sense to me, thanks for long description.

Because I'm familiar with open loop system, I understand it now, this is the way it should be in close loop system. However, is it possible for c program to save coordinates value for the first Reset button hit, and then second hit will restore them?

In captured video, I’m using Panasonic servo in velocity mode with encoder 2500 p/r, I noticed that motor is held in position (pulse or minus 1 encoder position shows in Axis status screen) and each time I click Reset button (actually click twice) the value sometimes increase by 8, 10, 15 but the value NEVER decrease. Can you point out this behavior?

Thanks
Weerasak

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Weerasak,
>  
> I don't think that is really a problem.  This just means that the commanded destination is slightly different after each reset.  Not that there is a loss or shift in position.  Each RESET the Init.c program reads the current measured encoder position and sets the commanded destination to match.  The encoder position is not reset or adjusted.  So if the servo has a small error (which it usually have at least a fraction of one encoder count) the commanded position is adjusted to match.  If the system is then moved somewhere (ie zero) it will always be to the same place.  You can verify this behavior by forcing a large error.  Command the axis to zero and mark the position.  Then force a big error of ~100mm (you might disable the amp).  Then RESET the system.  Mach3 will the report the position as ~100mm.  Command the axis back to zero and the position should repeat within the mechanical accuracy of your axis.
>  
> If you still feel this is a problem you could add a move in your Init program to a fixed machine coordinate.  But this could be dangerous for example if for some reason you need to RESET after some fault in the middle of cutting a part.
>  
> Does this make sense?
>  
> Regards
> TK
>
>
> ________________________________
> From: Weerasak <vrasak@...>
> To: DynoMotion@yahoogroups.com
> Sent: Friday, October 28, 2011 7:24 AM
> Subject: [DynoMotion] Re: Click Reset button cause x dro increase value
>
>
>  
> Hello,
>
> Youtube takes hours to process my uploaded video, I upload another one, here new link
>
> http://s389.photobucket.com/albums/oo335/vrasak/?action=view¤t=KflopKanalog1.mp4
>
> Thanks
> Weerasak
>
> This video is currently being processed.
>
> --- In DynoMotion@yahoogroups.com, "Weerasak" <vrasak@> wrote:
> >
> > Hello Tom,
> >
> > I have problem with EnableAxisDest (0,ch0->Position); command, each time I click the Reset button in Mach3, it increase the x value. Please see the video.
> >
> > http://www.youtube.com/watch?v=9rA8JLOvDeg
> >
> > pardon me, if you have already answered this problem,But I couldn't find it.
> >
> > Thanks
> > Weerasak
> >
>
Group: DynoMotion Message: 2055 From: Weerasak Date: 10/29/2011
Subject: Re: Click Reset button cause x dro increase value
Hello Tom,

While you were sleeping, I’m awake (we live on different side of the world) I've found the answer for the second paragraph that I previously asked you â€" because Mach3 scaling the encoder unit, if I put 10000 (2500x4) in Step per Unit in Mach3 motor tuning dialog. This time Mach3 will show same value as shown in Position in Axis Status screen.

Please answer the first paragraph, I still have no idea how to save and restore x, y, z position when we hit and re-hit the Reset button.

Thank you,
Weerasak

--- In DynoMotion@yahoogroups.com, "Weerasak" <vrasak@...> wrote:
>
> Hello Tom,
>
> Yes, it makes sense to me, thanks for long description.
>
> Because I'm familiar with open loop system, I understand it now, this is the way it should be in close loop system. However, is it possible for c program to save coordinates value for the first Reset button hit, and then second hit will restore them?
>
> In captured video, I’m using Panasonic servo in velocity mode with encoder 2500 p/r, I noticed that motor is held in position (pulse or minus 1 encoder position shows in Axis status screen) and each time I click Reset button (actually click twice) the value sometimes increase by 8, 10, 15 but the value NEVER decrease. Can you point out this behavior?
>
> Thanks
> Weerasak
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi Weerasak,
> >  
> > I don't think that is really a problem.  This just means that the commanded destination is slightly different after each reset.  Not that there is a loss or shift in position.  Each RESET the Init.c program reads the current measured encoder position and sets the commanded destination to match.  The encoder position is not reset or adjusted.  So if the servo has a small error (which it usually have at least a fraction of one encoder count) the commanded position is adjusted to match.  If the system is then moved somewhere (ie zero) it will always be to the same place.  You can verify this behavior by forcing a large error.  Command the axis to zero and mark the position.  Then force a big error of ~100mm (you might disable the amp).  Then RESET the system.  Mach3 will the report the position as ~100mm.  Command the axis back to zero and the position should repeat within the mechanical accuracy of your axis.
> >  
> > If you still feel this is a problem you could add a move in your Init program to a fixed machine coordinate.  But this could be dangerous for example if for some reason you need to RESET after some fault in the middle of cutting a part.
> >  
> > Does this make sense?
> >  
> > Regards
> > TK
> >
> >
> > ________________________________
> > From: Weerasak <vrasak@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Friday, October 28, 2011 7:24 AM
> > Subject: [DynoMotion] Re: Click Reset button cause x dro increase value
> >
> >
> >  
> > Hello,
> >
> > Youtube takes hours to process my uploaded video, I upload another one, here new link
> >
> > http://s389.photobucket.com/albums/oo335/vrasak/?action=view¤t=KflopKanalog1.mp4
> >
> > Thanks
> > Weerasak
> >
> > This video is currently being processed.
> >
> > --- In DynoMotion@yahoogroups.com, "Weerasak" <vrasak@> wrote:
> > >
> > > Hello Tom,
> > >
> > > I have problem with EnableAxisDest (0,ch0->Position); command, each time I click the Reset button in Mach3, it increase the x value. Please see the video.
> > >
> > > http://www.youtube.com/watch?v=9rA8JLOvDeg
> > >
> > > pardon me, if you have already answered this problem,But I couldn't find it.
> > >
> > > Thanks
> > > Weerasak
> > >
> >
>
Group: DynoMotion Message: 2056 From: Tom Kerekes Date: 10/29/2011
Subject: Re: Click Reset button cause x dro increase value
Hi Weerasak,
 
I think the shift of several counts rather than just one is because the first RESET disables the axis so there is a bit of drift before it is re-enabled.
 
I don't really see why this is a problem.  I think you can use the Mach3 REF ALL Home or something if you want to be at exactly a specific position like zero.
 
But anyway you could memorize the first RESET position and return to there on the next RESET.  I think you should add a test to make sure the current Position is close to last Position otherwise a large rapid motion migh result somebody Jogged or ran a job between the resets.
 
There are 100 global variables (defined as 32-bit integers -but you could save 64-bit doubles there by using pairs) that persist from Thread to Thread and over time.   They are called persist.UserData[100].  So you might do the following:
 
main()
{
    double New;
    double *LastX = (double *)persist.UserData[0];
    double *LastY = (double *)persist.UserData[2];
    double *LastZ = (double *)persist.UserData[4];
    
    New = ch0->Position;
    if (fast_fabs(New - *LastX) < TOL) New = *LastX;
    *LastX=New;
    EnableAxisDest(0,New);
    
    New = ch1->Position;
    if (fast_fabs(New - *LastY) < TOL) New = *LastY;
    *LastY=New;
    EnableAxisDest(1,New);
   
    New = ch2->Position;
    if (fast_fabs(New - *LastZ) < TOL) New = *LastZ;
    *LastZ=New;
    EnableAxisDest(2,New);
}
TK